var WASP_PRD_TEMPLATE = {
	submitForm : function() {
		if ($("#exportForm").valid()) {
			post("/solution/business/customerEquity/navInfo/exportNavInterfaceFile.do", {
				faCode: $.trim($("#faCode").val()),
				theDate: $.trim($("#theDate").val())
			});
		}
	},

	initJqValidate: function() {

		$("#exportForm").validate({
			focusCleanup : true,
			rules : {
				theDate : {
					required : true
				}
			},
			messages : {
				theDate : {
				  required:'请选择净值日期'
		        }
			}
		});
	}
};


$(function() {
	// 初始化校验
	WASP_PRD_TEMPLATE.initJqValidate();
	
	// 初始化日期控件
	WASP_WIDGET.triggerDateStyleWithYMD("#theDate");
})


// post 提交下载表单
function post(url, params) {
	var temp_form = document.createElement("form");      
	temp_form.action = url;
	temp_form.target = "_self";
	temp_form.method = "post";
	temp_form.style.display = "none";
	for (var x in params) {
		var opt = document.createElement("input");
	    opt.name = x;
	    opt.value = params[x];
	    temp_form.appendChild(opt);
	}
	document.body.appendChild(temp_form);
	temp_form.submit();
}